import numpy as np
from model_utils import load_model_and_scaler, predict_next_n_hours

def generate_load_kW_data():
    hours = np.arange(24)
    base_load = 120
    peak_load = 80
    daily_pattern = peak_load * np.sin((hours - 6) / 24 * 2 * np.pi) + peak_load
    noise = np.random.normal(0, 5, size=24)
    return (base_load + daily_pattern + noise).reshape(-1, 1)

if __name__ == "__main__":
    model_path = "saved_models/load_kW_lstm_model.pt"
    scaler_path = "saved_models/load_kW_scaler.pkl"

    model, scaler = load_model_and_scaler(model_path, scaler_path)
    input_data = generate_load_kW_data()

    print("模拟的load_kW 24小时输入数据：")
    print(input_data.flatten())

    preds = predict_next_n_hours(model, scaler, input_data)
    print("未来24小时load_kW预测值：")
    print(preds)
